<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	template="/layout/page/sample/left-right-template.xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:a4j="http://www.sinosoft.com.cn/a4j"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

	<ui:param name="compId" value="#{commonContentViewBean.id}" />
	<ui:param name="treeViewBean"
		value="#{commonContentViewBean.allView[0]}" />
	<ui:param name="compLeftTitle" value="帮助管理" />
	<ui:param name="catalogTabName" value="类别信息" />
	<ui:param name="topTitle" value="查询" />

	<ui:define name="compLeft">
		<h:form id="#{compId}_from">
					<p:commandButton
						onclick="#{commonContentViewBean.id}_dlg1.show();"
						title="添加帮助类别" image="ui-icon-disk" value="添加">
					</p:commandButton>
					<p:commandButton
						onclick="btnAction('#{commonContentViewBean.id}','v3.manage.help.helptype.add','400','300','icons/cog_edit.png','edit','helpdoc-scene','catalog-edit');"
						title="编辑帮助类别" image="ui-icon-edit" value="编辑">
					</p:commandButton>
					<p:commandButton actionListener="#{dspHelpMg.delete}"
						update="#{commonContentViewBean.id}_from:#{commonContentViewBean.id}_tree"
						onstart="if(confirm('确认要删除类别吗？')){return true;}else{return false;}"
						title="删除类别" image="ui-icon-trash" value="删除">
						<h:inputHidden value="#{treeViewBean.id}" />
					</p:commandButton>
			<ui:decorate
				template="/layout/iteration/tree/sino-tree-template.xhtml">
				<ui:param name="compViewBean" value="#{treeViewBean}" />
				<ui:param name="compId" value="#{commonContentViewBean.id}_tree" />
				<ui:param name="compSelectedNodeUpdate"
					value="#{commonContentViewBean.allView[1].id}_contentForm" />
			</ui:decorate>
			
		</h:form>

	</ui:define>

	<ui:define name="compRight">
	   <div style="width: 100%; height: 100%; overflow: auto;"><ui:include
					src="/service/func/setting/system/help/helpDocs.xhtml" /></div>
		<p:dialog header="选择添加的类型" widgetVar="#{commonContentViewBean.id}_dlg1" draggable="false" resizable="false" width="100" height="150">
				<p:selectOneRadio id="helptype" value=""
					onchange="changeType(this.value);">
					<f:selectItem itemLabel="类别" itemValue="d" />
					<f:selectItem itemLabel="内容" itemValue="f" />
				</p:selectOneRadio>
			</p:dialog>
			<script language="javaScript">
			function type(value)
			{
				if(value=="d")
				{
					#{commonContentViewBean.id}_dlg1.show();
				}else
			    {
				    alert("帮助详细信息下不能添加!")
				}
		    }
function changeType(value){
	if(value=="d"){
		writAction('#{commonContentViewBean.id}','v3.manage.help.helptype.add','400','300','icons/cog_add.png','add','helpdoc-scene','catalog-add',value);
		#{commonContentViewBean.id}_dlg1.hide();

	}else if(value=="f")
    {
		writAction('#{commonContentViewBean.id}','v3.manage.help.helpLayout.add','700','550','icons/cog_add.png','add','helpdoc-scene','help-add',value);
        #{commonContentViewBean.id}_dlg1.hide();
 	}
}
</script>

	</ui:define>
</ui:composition>
